import 'package:flutter_clx_base/flutter_clx_base.dart';

import 'home/index.dart';
import 'mine/index.dart';
import 'query/index.dart';
import 'statistics/index.dart';

class MainController extends GetxController {
  MainController();

  int homePosition = 0;

  final List selectedIcon = [
    Icons.home,
    Icons.add_circle_sharp,
    Icons.bar_chart,
    Icons.person,
  ];

  final List<Widget> pageList = [
    const HomePage(),
    const QueryPage(),
    const StatisticsPage(),
    const MinePage()
  ];

  _initData() {
    update(["main"]);
  }

  void onTap(int pos) {
    homePosition = pos;
    _initData();
  }

  // @override
  // void onInit() {
  //   super.onInit();
  // }

  @override
  void onReady() {
    super.onReady();
    _initData();
  }

  // @override
  // void onClose() {
  //   super.onClose();
  // }
}
